package com.ruoyi.web.controller.Base;


import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.framework.web.domain.server.Sys;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

@RestController
@RequestMapping("/log")
public class LogController {
    @Value("${iprestriction}")
    String value ;
    @PostMapping("/add")
    public AjaxResult log(@RequestBody Object log){
        System.out.println(log.toString());
        System.out.println("sdddd");
        return AjaxResult.success();
    }
    @RequestMapping(value = "/testlog")
    public JSONObject testlog(HttpServletRequest request) throws IOException {
        return JSONObject.parseObject(request.getReader().readLine());
    }
    @RequestMapping(value = "/ip")
    public String getIpAddr(HttpServletRequest request) {
        String ip ="hhhh";
        return ip+value;
    }
}
